package day01.wc

import org.apache.spark.{SparkConf, SparkContext}

/**
 * @Author wsl
 * @Description  yarn模式
 */
object WC_yarn {
  def main(args: Array[String]): Unit = {
    val conf: SparkConf = new SparkConf().setAppName("wc")//.setMaster("local[*]")
    val sc = new SparkContext(conf)

    sc.textFile(args(0))
      .flatMap(_.split(" "))
      .map( (_, 1))
      .reduceByKey(_+_)
      .saveAsTextFile(args(1))

    sc.stop()
  }
}
